#!/usr/bin/env python3

import numpy as np
import matplotlib.pyplot as plt

X = np.linspace(-np.pi, np.pi, 256)
Y = np.sin(X)
plt.plot(X, Y)
#隐藏所有的刻度 fig = plt.figure()  ax = fig.add_subplot(111)
ax = plt.gca()
ax.set_xticks([])
ax.set_yticks([])
#隐藏上面和右边的轴线
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
#设置左边的轴线为红色，下边的轴线为蓝色
ax.spines['left'].set_color('red')
ax.spines['bottom'].set_color('blue')
#移动左边和下边的轴线到数据的零点
ax.spines['left'].set_position('zero')
ax.spines['bottom'].set_position('zero')

plt.show()

